<template>
	<view :data-theme="theme">

		<view
			style="width: 100%;height: 500rpx;align-items: center;display: flex;justify-content: center;flex-direction: column;">
			<text class="iconfont icon-duihao2"
				style="background-color: #12b356;width: 160rpx;height: 160rpx;font-size: 33px;text-align: center;line-height: 160rpx;border-radius: 80rpx;color: #FFF;margin-bottom: 40rpx;"></text>
			<text style="font-size: 38rpx;font-weight: bold;">活动报名成功</text>
		</view>
		<view style="text-align: center;">
			<text style="color: #000;font-size: 31rpx;font-weight: bolder;">共<span
					style="color: #0056ff;">{{productData.length}}</span>件商品报名活动</text>
		</view>

		<!-- 商品信息 -->
		<scroll-view class="scroll-views print_center" @scrolltolower="scrolltolowerFn" scroll-y
			style="height: 100%;width: 92%; overflow: hidden;">
			<label class="uni-list-cell checke_item" v-for="(item, index) in productData" :key="index">
				<view class="item_top">
					<view class="item_img">
						<u--image :showLoading="true" :src="item.image" width="70px" height="70px"></u--image>
					</view>
					<view class="item_right">
						<text class="u-line-1"><span v-if="item.brandName">[{{item.brandName}}]</span>{{item.name}}<span style="margin-left: 10rpx;">{{item.sku}}</span></text>
						<view class="item_bottom" style="font-size: 29rpx;color: #808080;margin: 10rpx 0;">
							<span style="display: inline-block;margin-right: 30rpx;">{{item.operateCityName}}
							</span>
						</view>
					</view>
				</view>
			</label>

		</scroll-view>

		<!-- 底部 -->
		<view style="position: fixed;bottom: 0px;width: 100%;padding: 10px;background-color: #FFF;">
			<view style="align-items: center;">

				<button @click="registActive()" class="bg_color"
					style="border-radius: 16rpx;color: #FFF;font-weight: bold;font-size: 30rpx;padding:14rpx 20rpx;margin-left: 10rpx;"
					:color="bgColor">返回活动列表</button>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		setThemeColor
	} from '@/utils/setTheme.js';
	let app = getApp();
	export default {
		data() {
			return {
				bgColor: "#ffffff",
				theme: app.globalData.theme,
				productData: [],
			};
		},
		onLoad(options) {
			this.bgColor = setThemeColor()
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: this.bgColor,
			});
			let that = this;
			that.productData = JSON.parse(options.data)
		},
		methods:{
			/** 
			返回活动列表页面
			 */
			registActive(){
				this.goPage(`/pages/marketing/marketing`)
			},
			goPage(url) {
				uni.navigateTo({
					url
				});
			},
			
		}
	}
</script>

<style lang="scss">
	.bg_color {
		@include main_bg_color(theme);
	}

	// 商品列表
	.print_center {
		// flex: 1;
		display: flex;
		flex-direction: column;
		overflow: scroll;

		// width: 100%;
		margin: 30rpx;

		.checke_item {
			display: flex;
			flex-direction: column;
			// justify-content: space-around;
			// align-items: center;
			background-color: white;
			padding: 20rpx;
			margin-top: 10px;
			// width: 100%;
			border-radius: 20rpx;

			.item_top {
				display: flex;

				.item_img {
					margin-right: 10px;
					align-items: center;

					image {
						width: 50px;
						height: 70px;
					}

				}

				.item_right {
					font-weight: bold;
					line-height: 20px;
				}
			}

			.item_bottom {
				display: flex;
				align-items: center;
				// justify-content: flex-end;

				.counter {
					display: flex;
					justify-content: space-between;
					align-items: center;
					width: 100px;
					height: 30px;
					border: 1px solid #ccc;
					border-radius: 5px;
					overflow: hidden;
				}

				.counter text {
					width: 40px;
					height: 30px;
					text-align: center;
					line-height: 30px;
					font-size: 16px;
					color: #333;
				}
			}
		}

	}
</style>